package com.flyme.module.base.provider.service.impl;

import com.flyme.common.core.model.query.CriteriaQuery;
import com.flyme.common.core.model.query.PagerInfo;
import com.flyme.core.base.supper.entity.EntityMap;
import com.flyme.core.base.supper.service.impl.BaseServiceImpl;
import com.flyme.module.base.client.entity.SysFiction;
import com.flyme.module.base.client.entity.SysWorkCourse;
import com.flyme.module.base.client.enums.WorkingYearEnum;
import com.flyme.module.base.provider.mapper.SysFictionMapper;
import com.flyme.module.base.provider.mapper.SysWorkCourseMapper;
import com.flyme.module.base.provider.service.SysFictionService;
import com.flyme.module.base.provider.service.SysWorkCourseService;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * @author: zyf
 * @date: 2018/10/24 16:33
 * @description:
 */
@Service
@Transactional(rollbackFor = Exception.class)
public class SysFictionServiceImpl extends BaseServiceImpl<SysFictionMapper, SysFiction> implements SysFictionService {

    /**
     * 首页查询小说
     */
    public List<EntityMap> selectFictions(){
        PagerInfo pagerInfo = new PagerInfo();
        pagerInfo.setPageSize(5);
        pagerInfo.setPageNumber(1);
        CriteriaQuery queryWrapper = new CriteriaQuery<EntityMap>(pagerInfo);
        queryWrapper.select("id,fictionName,fictionImg,fictionUrl,createTime");
        List<EntityMap> list = (List<EntityMap>) pageList(queryWrapper).getRows();
        return list;
    }

}
